package huangbiao;

public class spent3{
public static void main(String []args) {
     String str = "192.168.1.0";
    String []firstArray = str.split("\\.");
     String []secondArray = str.split("\\.",4);
     System.out.println("str的原值是：["+str+"]");
     System.out.println("全部分割结果是");
     for(String a:firstArray) {
    	 System.out.println(a);
     }
    	 System.out.println();
    	 System.out.print("分割两次的结果");
    	 for(String a:secondArray) {
    		 System.out.print("["+a+"]");
    	 }
    	 System.out.println();
    	 System.out.println();
    	 System.out.print("分割两次的结果");
    	 for(String a:secondArray) {
    		 System.out.print("["+a+"]");
    	 }
    	 System.out.println();
    	 }
     }
